package com.carey.blog.repository;

import org.json.JSONObject;

import com.carey.blog.framework.latke.repository.Repository;
import com.carey.blog.framework.latke.repository.RepositoryException;

/**
 * External blogging system article(for sync)-Solo article repository.
 * 
 */
public interface ExternalArticleSoloArticleRepository extends Repository {

	/**
	 * Gets Solo article id by the specified external blogging system name and
	 * external article id.
	 * 
	 * @param externalArticleId
	 *            the specified external blog article id
	 * @param externalBloggingSys
	 *            external blogging system name
	 * @return Solo article id, returns {@code null} if not found
	 * @throws RepositoryException
	 *             repository exception
	 */
	String getSoloArticleId(final String externalArticleId,
			final String externalBloggingSys) throws RepositoryException;

	/**
	 * Gets a Solo article by the specified external blogging system name and
	 * external article id.
	 * 
	 * @param externalArticleId
	 *            the specified external blog article id
	 * @param externalBloggingSys
	 *            external blogging system name
	 * @return Solo article, returns {@code null} if not found
	 * @throws RepositoryException
	 *             repository exception
	 */
	JSONObject getSoloArticle(final String externalArticleId,
			final String externalBloggingSys) throws RepositoryException;

	/**
	 * Gets a external blog article-Solo article relation by the specified
	 * external blogging system name and external article id.
	 * 
	 * @param externalArticleId
	 *            the specified external article id
	 * @param externalBloggingSys
	 *            external blogging system name
	 * @return the relation, {@code null} if not found
	 * @throws RepositoryException
	 *             repository exception
	 */
	JSONObject getByExternalArticleId(final String externalArticleId,
			final String externalBloggingSys) throws RepositoryException;

	/**
	 * Gets an external blog article-Solo article relation by the specified
	 * external blogging system name and Solo article id.
	 * 
	 * @param soloArticleId
	 *            the specified Solo article id
	 * @param externalBloggingSys
	 *            external blogging system name
	 * @return the relation, {@code null} if not found
	 * @throws RepositoryException
	 *             repository exception
	 */
	JSONObject getBySoloArticleId(final String soloArticleId,
			final String externalBloggingSys) throws RepositoryException;
}
